import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

/** 库存配货规则-列表 */
export const getRulePage = (params?: object) => {
  return http.request<any>(
    "get",
    baseUrlApi("/stockGoodsDistributeRule/page"),
    { params }
  );
};

/** 库存配货规则--新增 */
export const ruleAdd = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/stockGoodsDistributeRule/add"),
    { data }
  );
};

/** 库存配货规则--编辑 */
export const ruleUpdate = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/stockGoodsDistributeRule/update"),
    { data }
  );
};

/** 库存配货规则-删除 */
export const ruleDelete = (id?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi(`/stockGoodsDistributeRule/delete?id=${id}`)
  );
};
